﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotClientService.Models.Lg;
/// <summary>
/// 密封钉焊接判定条件
/// </summary>
public class LgSealJudge
{
    /// <summary>
    /// 焊接峰值功率上限
    /// </summary>
    public double WeldingPeakPowerUpperLimit { get; set; } = 9.99;

    /// <summary>
    /// 焊接峰值功率下限
    /// </summary>
    public double WeldingPeakPowerLowerLimit { get; set; } = 9.99;

    /// <summary>
    /// 焊接能量上限
    /// </summary>
    public double WeldingEnergyUpperLimit { get; set; } = 99.99;

    /// <summary>
    /// 焊接能量下限
    /// </summary>
    public double WeldingEnergyLowerLimit { get; set; } = 99.99;

    /// <summary>
    /// 焊接频率上限
    /// </summary>
    public double WeldingFrequencyUpperLimit { get; set; } = 999;

    /// <summary>
    /// 焊接频率下限
    /// </summary>
    public double WeldingFrequencyLowerLimit { get; set; } = 999;

    /// <summary>
    /// 焊接脉宽上限
    /// </summary>
    public double WeldingPulseWidthUpperLimit { get; set; } = 9;

    /// <summary>
    /// 焊接脉宽下限
    /// </summary>
    public double WeldingPulseWidthLowerLimit { get; set; } = 9;

    /// <summary>
    /// 焊接离焦量上限
    /// </summary>
    public double WeldingDefocusAmountUpperLimit { get; set; } = -0.9;

    /// <summary>
    /// 焊接离焦量下限
    /// </summary>
    public double WeldingDefocusAmountLowerLimit { get; set; } = -0.9;

    /// <summary>
    /// 焊接速度上限
    /// </summary>
    public double WeldingSpeedUpperLimit { get; set; } = 99;

    /// <summary>
    /// 焊接速度下限
    /// </summary>
    public double WeldingSpeedLowerLimit { get; set; } = 99;

    /// <summary>
    /// 焊接保护气流量上限
    /// </summary>
    public double WeldingShieldingGasFlowUpperLimit { get; set; } = 99.99;

    /// <summary>
    /// 焊接保护气流量下限
    /// </summary>
    public double WeldingShieldingGasFlowLowerLimit { get; set; } = 99.99;

    public override string ToString()
    {
        return $"{WeldingPeakPowerUpperLimit.ToString().PadLeft(4,'0')}" +
               $"{WeldingPeakPowerLowerLimit.ToString().PadLeft(4,'0')}" +
               $"{WeldingEnergyUpperLimit.ToString().PadLeft(5,'0')}" +
               $"{WeldingEnergyLowerLimit.ToString().PadLeft(5,'0')}" +
               $"{WeldingFrequencyUpperLimit.ToString().PadLeft(3,'0')}" +
               $"{WeldingFrequencyLowerLimit.ToString().PadLeft(3,'0')}" +
               $"{WeldingPulseWidthUpperLimit.ToString().PadLeft(1,'0')}" +
               $"{WeldingPulseWidthLowerLimit.ToString().PadLeft(1, '0')}" +
               $"{WeldingDefocusAmountUpperLimit.ToString().PadLeft(4, '0')}" +
               $"{WeldingDefocusAmountLowerLimit.ToString().PadLeft(4, '0')}" +
               $"{WeldingSpeedUpperLimit.ToString().PadLeft(2, '0')}" +
               $"{WeldingSpeedLowerLimit.ToString().PadLeft(2, '0')}" +
               $"{WeldingShieldingGasFlowUpperLimit.ToString().PadLeft(5, '0')}" +
               $"{WeldingShieldingGasFlowLowerLimit.ToString().PadLeft(5, '0')}";
    }
}

